/**
 * ... Spread 展开运算符
 */

const user = { name: "张三", age: 20 };
const other = { gender: "男", age: 21 };
const userClone = { ...user, ...other };
console.log(userClone);
// userClone = {
//     name: user.name,
//     age: user.age,
// }
// userClone = Object.assign({}, user, other);

const arr = ["red", "green", "blue"];
const arrOther = ["white", "black"];
const arrClone = [...arr, ...arrOther];
// arrClone = [arr[0], arr[1], arr[2]];
// arrClone = arr.concat(arrOther);
console.log(arrClone);
